package Encapsulation.封装;

//定义接口
interface printable{

    void print(String str);
}

//定义方法类，转换大小写
class stringUtils{

    public void stringToUpper(String str){
        System.out.println(str.toUpperCase());
    }

}

public class tanaPoint {

    private static void printUpper(String text,printable p){
        p.print(text);
    }

    public static void main(String[] args) {

        stringUtils s = new stringUtils();
        printUpper("Hello",str -> s.stringToUpper(str));
        printUpper("Hello",s::stringToUpper);
    }
}
